<?php
/* @var $this RosterController */
/* @var $model Schedule */
/**/
?>

<div id="viewSchedule">

<?php

if ($model != null):
 $this->renderPartial('_ajaxViewSchedule_form',array('model'=>$model,'date'=>$date),false,true); ?>

<br>
<?php

if (!($model->wasChanged)) {
	echo CHtml::link('Create Shift Change',Yii::app()->createUrl("shiftChange/rosterCreate",array("user"=> $model->iduser,"date"=>$date)));
	echo "<br>";
	/*** FOR AJAX INTERACTION... REMOVED TEMPORARILY
	echo CHtml::ajaxLink ('Create Shift Change Ajax',
						 Yii::app()->createUrl("shiftChange/ajaxRosterCreate",
											   array("user"=> $model->iduser,"date"=>$date)),
						 array('update' => '#leftVisor'),
						 array('id'=>'rosterCreate'.$model->idschedule) 
						);
	*/
} else {
	echo CHtml::link('Go to Shift Change',Yii::app()->createUrl("shiftChange/managementView",array("id"=> $model->changeId)),array('target' => '_blank'));
}	
else: ?>

<br><br>

<CENTER>
    <div class="flash-success-roster" style="width:300px;">
        <center>
		<?php 
		//echo "user = ".$userid." date= ".$date."<br>";
		echo "<h8>No Schedule Assigned</h8><br>";
		echo "For <span style='color:red;'>". User::model()->findByPk($userid)->username."</span> For This Day<br>";
		echo CHtml::link('Assign Temporal Shift?',Yii::app()->createUrl("shiftChange/rosterCreateEmpty",array("user"=> $userid,"date"=>$date)),array('style'=>'font-size:13px;'));
		echo "<br>";
		echo CHtml::link('Assign Permanent Shift?',Yii::app()->createUrl("schedule/admin",array("id"=> $userid)),array('style'=>'font-size:13px;'));
		?>
		</center>
    </div>
<BR><br>
<?php

endif;

?>
</CENTER>
</div>